//
//  TeamManagerViewController.m
//  TenThousand
//
//  Created by 宁宁 on 16/7/25.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "TeamManagerViewController.h"

@interface TeamManagerViewController ()<UIScrollViewDelegate>

@end

@implementation TeamManagerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"管理团队";
    
    self.view.backgroundColor = [UIColor colorWithRed:237/255.0 green:237/255.0 blue:237/255.0 alpha:1];
    
    [self setView];
}

- (void)setView{
    
    UIScrollView * scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height - 64)];
    scroll.showsHorizontalScrollIndicator = YES;
    scroll.delegate = self;
    scroll.backgroundColor = [UIColor clearColor];
    [self.view addSubview:scroll];
    
    UIView *bgview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, Screen_Width, 1000)];
    bgview.backgroundColor = [UIColor whiteColor];
    
    NSString *intro = @"    首席执行官\n    早年在大型金融集团公司为国内广大投资者和高净值人群提供财富管理咨询，对国内外金融市场发展规律有自己独到的见解；洞悉国内互联网金融市场，联合志同道合之士创办了萬元富互联网金融信息服务平台，负责萬元富平台整体运作。";
    NSString *good = @"    擅长：兼并、收购、投资和资产出售，领导和推动项目的实施；";
    
    NSString *intro2 = @"    首席运营官\n    早年在某集团公司时自己所带领的部门为集团公司在上海证券交易所上市前贡献了近20亿营业额；互联网领域鏖战了近十年，十年磨一剑，精通互联网运营各个环节，成为运营及产品的双料大师，为多家国际知名品牌公司操盘互联网运营、产品、推广，成功打赢多个经典精彩的互联网营销战！\n    联合创立萬元富，整体操盘萬元富互联网运营。";
    
    
    //设置label行距
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:9];
    
    
    NSMutableAttributedString *attributedString1intro = [[NSMutableAttributedString alloc] initWithString:intro];
    NSMutableAttributedString *attributedString1good = [[NSMutableAttributedString alloc] initWithString:good];
    
    NSMutableAttributedString *attributedString2intro = [[NSMutableAttributedString alloc] initWithString:intro2];
    
    //行距
    [attributedString1intro addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [intro length])];
    [attributedString1good addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [good length])];
    
    [attributedString2intro addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [intro2 length])];
    
    //字体
    [attributedString1intro addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(4, 10)];
    [attributedString1good addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(4, 3)];
    
    [attributedString2intro addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(4, 10)];
    
    
    //胡开岳
    UILabel *name1 = [[UILabel alloc] initWithFrame:CGRectMake(8, 15, Screen_Width - 16 - 16, 20)];
    name1.text = @"一、胡开岳\n";
    name1.font = [UIFont boldSystemFontOfSize:16];
    [bgview addSubview:name1];
    
    //职位 经历
    UILabel *introduction = [[UILabel alloc] initWithFrame:CGRectMake(8, name1.frame.origin.y + name1.frame.size.height + 9, Screen_Width - 16 - 16, 1000)];
    [bgview addSubview:introduction];
    introduction.font = [UIFont systemFontOfSize:14];
    introduction.numberOfLines = 0;
    introduction.attributedText = attributedString1intro;
    [introduction sizeToFit];
    
    //擅长
    UILabel *goodFor = [[UILabel alloc] initWithFrame:CGRectMake(8, introduction.frame.origin.y + introduction.frame.size.height + 9, Screen_Width - 16 - 16, 1000)];
    [bgview addSubview:goodFor];
    goodFor.font = [UIFont systemFontOfSize:14];
    goodFor.numberOfLines = 0;
    goodFor.attributedText = attributedString1good;
    [goodFor sizeToFit];
    
    
    //解海东
    UILabel *name2 = [[UILabel alloc] initWithFrame:CGRectMake(8, goodFor.frame.origin.y + goodFor.frame.size.height + 30, Screen_Width - 16 - 16, 20)];
    name2.text = @"二、解海东\n";
    name2.font = [UIFont boldSystemFontOfSize:16];
    [bgview addSubview:name2];
    
    //职位 经历
    UILabel *introduction2 = [[UILabel alloc] initWithFrame:CGRectMake(8, name2.frame.origin.y + name2.frame.size.height + 9, Screen_Width - 16 - 16, 1000)];
    [bgview addSubview:introduction2];
    introduction2.font = [UIFont systemFontOfSize:14];
    introduction2.numberOfLines = 0;
    introduction2.attributedText = attributedString2intro;
    [introduction2 sizeToFit];
    
    
    bgview.frame = CGRectMake(8, 8, Screen_Width - 16, introduction2.frame.size.height + introduction2.frame.origin.y + 10);
    [scroll addSubview:bgview];
    scroll.contentSize = CGSizeMake(Screen_Width, bgview.frame.size.height + 16);
}

@end
